-
Notifications
You must be signed in to change notification settings - Fork 4k
[Az.Computer] Update generation tool version: autorest.powershell v3->v4 #28303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
To the author of the pull request, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the autorest PowerShell generation tool from version 3 to version 4 for the Az.Compute module. The update introduces new API patterns, parameter sets, and breaking changes to support the newer autorest.powershell v4 generation framework.
Key changes include:
- Migration from API versioned types to generic interface types in cmdlet signatures
- Addition of new parameter sets with JSON file and string input options
- Introduction of new identity-based parameter sets for better resource management
Reviewed Changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tools/StaticAnalysis/Exceptions/Az.Compute/BreakingChangeIssues.csv | Added 35 new breaking change exceptions for type and parameter changes introduced by autorest v4 |
Multiple help/*.md files | Updated parameter sets, types, and documentation to reflect new autorest v4 patterns |
Multiple docs/*.md files | Updated autorest-generated documentation with new parameter sets and type signatures |
src/Compute/Compute.Autorest/generate-info.json | Updated generation ID for new autorest v4 build |
src/Compute/Compute.Autorest/README.md | Removed explicit autorest v3 configuration and updated directive patterns |
Multiple custom/*.ps1 files | Updated custom cmdlet implementations with new type signatures and parameter sets |
"Az.Compute","Get-AzGalleryApplicationVersion","Get-AzGalleryApplicationVersion","0","3000","The type of property 'ProvisioningState' of type 'Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20220103.IGalleryApplicationVersion' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Compute.Support.GalleryProvisioningState]' to 'System.String'.","Change the type of property 'ProvisioningState' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Compute.Support.GalleryProvisioningState]'." | ||
"Az.Compute","Get-AzGalleryApplicationVersion","Get-AzGalleryApplicationVersion","0","3000","The type of property 'PublishingProfileReplicationMode' of type 'Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20220103.IGalleryApplicationVersion' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Compute.Support.ReplicationMode]' to 'System.String'.","Change the type of property 'PublishingProfileReplicationMode' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Compute.Support.ReplicationMode]'." | ||
"Az.Compute","Get-AzGalleryApplicationVersion","Get-AzGalleryApplicationVersion","0","3000","The type of property 'PublishingProfileStorageAccountType' of type 'Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20220103.IGalleryApplicationVersion' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Compute.Support.StorageAccountType]' to 'System.String'.","Change the type of property 'PublishingProfileStorageAccountType' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Compute.Support.StorageAccountType]'." | ||
"Az.Compute","Get-AzGalleryApplicationVersion","Get-AzGalleryApplicationVersion","0","2020","The cmdlet 'Get-AzGalleryApplicationVersion' no longer supports the type 'Microsoft.Azure.PowerShell.Cmdlets.Compute.Support.ReplicationStatusTypes' for parameter 'Expand'.","Change the type for parameter 'Expand' back to 'Microsoft.Azure.PowerShell.Cmdlets.Compute.Support.ReplicationStatusTypes'." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This breaking change from strongly-typed enum to string for the 'Expand' parameter reduces type safety. Consider if this change is necessary or if the enum type can be preserved to maintain compile-time validation.
Copilot uses AI. Check for mistakes.
directive: | ||
# Following is two common directive which are normally required in all the RPs | ||
# 1. Remove the unexpanded parameter set | ||
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well | ||
- where: | ||
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ | ||
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The regex pattern uses a negative lookahead which may be difficult to understand and maintain. Consider documenting this pattern or using a more explicit approach to specify which variants should be removed.
Copilot uses AI. Check for mistakes.
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Category('Body')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.Compute.Support.OperatingSystemTypes] | ||
[System.String] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change from strongly-typed OperatingSystemTypes enum to string reduces type safety and removes IntelliSense support. The PSArgumentCompleter attribute helps but doesn't provide the same compile-time validation as the original enum type.
Copilot uses AI. Check for mistakes.
Description
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.md
and reviewed the following information:ChangeLog.md
file(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
.## Upcoming Release
header in the past tense.ChangeLog.md
if no new release is required, such as fixing test case only.